export function searchColumns() {
  return [
    {
      prop: 'film_name',
      placeholder: '请输入影片名称',
    },
    {
      filterable: true,
      type: 'select',
      prop: 'channel',
      placeholder: '请选择渠道',
      dicData: this.channelList?.list,
      props: {
        value: 'no',
        label: 'no',
      },
    },
    {
      prop: 'dateRange',
      type: 'daterange',
    },
  ]
}

export function tableColumns() {
  return [
    {
      width: 140,
      label: '日期',
      prop: 'date',
      formatter: row => this.$formatTime(row?.date),
    },
    {
      width: 120,
      label: '渠道',
      prop: 'channel',
    },
    {
      overHidden: true,
      align: 'left',
      label: '影片名称',
      prop: 'film_name',
    },
    {
      overHidden: true,
      align: 'left',
      label: '营销关键词',
      prop: 'keywords_name',
      formatter: row => row?.keywords_name?.map(it => it.name).join(','),
    },
    {
      align: 'right',
      width: 120,
      label: '观看次数',
      prop: 'view_count',
      formatter: row => `${row?.view_count}次`,
    },
    {
      align: 'right',
      width: 120,
      label: '观看时长(分)',
      prop: 'duration',
      formatter: row => `${(row?.duration / 60).toFixed(2)}`,
    },
    {
      align: 'right',
      width: 120,
      label: '影片购买次数',
      prop: 'purchase_count',
      formatter: row => `${row?.purchase_count}次`,
    },
  ]
}
